package com.supermap.dataservice.cloud.commodity;

import com.alibaba.dubbo.config.annotation.Service;
import com.supermap.dataservice.cloud.productC.ProductCloudMapper;
import com.supermap.dataservice.mysql.config.DynamicDataSourceContextHolder;
import com.supermap.dataservice.util.JSONUtils;
import com.supermap.dubbo.api.cloud.commodity.CommodityService;

import javax.annotation.Resource;

/**
 * @author aqua
 * @desc
 * @date 2019年04月11 15:54
 * @email 1301584033@qq.com
 */
@Service
public class CommodityServiceImpl  implements CommodityService {


    @Resource
    private CommodityMapper commodityMapper;
    @Override
    public JSONUtils getCommodityList(String commodityName, Integer pageNum, Integer pageSize) {
        DynamicDataSourceContextHolder.setDataSourceKey("ds4");
        return new JSONUtils().setData(commodityMapper.getCommodityList(commodityName,pageNum,pageSize)).setCountSum(commodityMapper.getCommodityListCountSum(commodityName));
    }
}
